// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-28

package kind

// WithdrawalState
// 提现状态.
type WithdrawalState int

const (
	_ WithdrawalState = iota

	WithdrawalStateApplied        // 已申请待处理
	WithdrawalStateProcessing     // 数据处理中
	WithdrawalStateProcessFailed  // 处理失败
	WithdrawalStateProcessSucceed // 处理成功
)

var (
	withdrawalStateText = map[WithdrawalState]string{
		WithdrawalStateApplied:        "已申请待处理",
		WithdrawalStateProcessing:     "数据处理中",
		WithdrawalStateProcessFailed:  "处理失败",
		WithdrawalStateProcessSucceed: "处理成功",
	}
	withdrawalStateUnknown = "未知"
)

func (o WithdrawalState) IsApplied() bool    { return o == WithdrawalStateApplied }
func (o WithdrawalState) IsProcessing() bool { return o == WithdrawalStateProcessing }
func (o WithdrawalState) IsFailed() bool     { return o == WithdrawalStateProcessFailed }
func (o WithdrawalState) IsSucceed() bool    { return o == WithdrawalStateProcessSucceed }

func (o WithdrawalState) Text() string {
	if str, ok := withdrawalStateText[o]; ok {
		return str
	}
	return withdrawalStateUnknown
}
